import Home from '../views/home'
import Cart from '../views/cart'
import Classic from '../views/classic'
import Details from '../views/details'
import Sales from '../views/details/sales'
import Price from '../views/details/price'
import News from '../views/details/news'
import Login from '../views/login'
// import Register from '../views/register'
import Mine from '../views/mine'
import Tabbar from '@/components/Tabbar'
import SearchHeader from '@/components/SearchHeader'
import TitleHeader from '@/components/TitleHeader'
import SubClassic from '@/views/classic/SubClassic'
import TitleClassical from '@/components/TitleClassical'
import SpecDetails from '@/views/specdetails/SpecDetails'
import TitleDetails from '@/components/TitleDetails'
import CollectCoupons from '../views/CollectCoupons'
const routers = [
  {
    path: '/',
    redirect: '/home',
    meta: {}
  },
  {
    path: '/home',
    name: 'home',
    components: {
      default: Home,
      footer: Tabbar,
      header: SearchHeader
    },
    meta: {
      isNav: true,
      title: '主页',
      icon: '&#xe656;',
      info: '更多'
    }
  },
  {
    path: '/classic',
    name: 'classic',
    components: {
      default: Classic,
      footer: Tabbar,
      header: TitleClassical
    },
    meta: {
      isNav: true,
      title: '分类',
      icon: '&#xe601;',
      info: '更多'
    },
    children: [ // 嵌套路由（子路由）
      {
        path: 'cla/:id', // 如果没有后面的参数是无法跳转子路由页面
        name: 'cla',
        component: SubClassic,
        meta: {
          title: '详细',
          info: '更多'
        }
      }
    ]
  },
  {
    path: '/details',
    name: 'details',
    components: {
      default: Details,
      header: TitleDetails
    },
    meta: {
      isNav: false,
      title: '详情列表',
      icon: '&#xe657;',
      info: '更多'
    }
  },
  {
    path: '/sales',
    name: 'sales',
    components: {
      default: Sales,
      header: TitleDetails
    },
    meta: {
      isNav: false,
      title: '详情列表',
      icon: '&#xe657;',
      info: '更多'
    }
  },
  {
    path: '/price',
    name: 'price',
    components: {
      default: Price,
      header: TitleDetails
    },
    meta: {
      isNav: false,
      title: '详情列表',
      icon: '&#xe657;',
      info: '更多'
    }
  },
  {
    path: '/news',
    name: 'news',
    components: {
      default: News,
      header: TitleDetails
    },
    meta: {
      isNav: false,
      title: '详情列表',
      icon: '&#xe657;',
      info: '更多'
    }
  },
  {
    path: '/specdetails/:id',
    name: 'SpecDetails',
    components: {
      default: SpecDetails,
      header: TitleHeader
    },
    meta: {
      isNav: false,
      title: '详情信息',
      icon: '&#xe657;',
      info: '更多'
    }
  },
  {
    path: '/cart',
    name: 'cart',
    components: {
      default: Cart,
      footer: Tabbar,
      header: TitleHeader
    },
    meta: {
      isNav: true,
      title: '购物车',
      icon: '&#xe600;',
      info: '更多'
    }
  },
  {
    path: '/mine',
    name: 'mine',
    components: {
      default: Mine,
      footer: Tabbar
      // header: TitleHeader
    },
    meta: {
      isNav: true,
      title: '我的考拉',
      icon: '&#xe603;',
      info: '退出登录'
    }
  },
  {
    path: '/login',
    name: 'login',
    components: {
      // header: SearchHeader,
      default: Login
    },
    meta: {
      isNav: false,
      info: '更多'
    }
  },
  {
    path: '/CollectCoupons',
    name: 'CollectCoupons',
    components: {
      default: CollectCoupons
    },
    meta: {
      isNav: true,
      title: '领券中心',
      icon: '&#xe656;',
      info: '更多'
    }
  }
]

export default routers
